<!-- 下拉框：需要文章分类数据 -->
<script setup>
import { ref } from 'vue'
import { artChannelService } from '@/api/article.js'

defineProps({
  modelValue: {
    type: [Number, String]
  }
})

const emit = defineEmits(['update:modelValue'])

const channelList = ref([])
const getChannel = async () => {
  const { data } = await artChannelService()
  channelList.value = data.data
}
getChannel()
</script>
<template>
  <el-select
    :modelValue="modelValue"
    @update:modelValue="emit('update:modelValue', $event)"
    placeholder="请选择"
  >
    <el-option
      v-for="channel in channelList"
      :key="channel.id"
      :label="channel.cate_name"
      :value="channel.id"
    />
  </el-select>
</template>
